﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web;

namespace WebUpload.Controllers
{
    public class FileController : ApiController
    {
        #region 单图上传
        [Route("Upload/Image")]
        [HttpPost]
        public string Image(File.Image image)
        {
            string[] strArray = image.base64.Split(',');
            string base64 = strArray[1];
            Bitmap bitmap= Common.CustomIO.BytesToBitmap(base64);
            bitmap.Save(HttpContext.Current.Server.MapPath("/Upload/test.jpg"));
            return "success";
        }
        #endregion
    }
}
